//
//  TableViewCell.swift
//  颖姐姐
//
//  Created by wu on 2017/7/5.
//  Copyright © 2017年 wu. All rights reserved.
//

import UIKit
import Kingfisher

class TableViewCell: UITableViewCell {

    @IBOutlet weak var pHeight: NSLayoutConstraint!
    @IBOutlet weak var pictureView: PIcView!
    @IBOutlet weak var cityLable: UILabel!
    @IBOutlet weak var nickLasble: UILabel!
    @IBOutlet weak var headIV: UIImageView!
    @IBOutlet weak var contentLable: UILabel!
    
    
    var model:Model?{
        didSet{
            cityLable.text = model?.distance
            nickLasble.text = model?.user?.nickname
            contentLable.text = model?.content
            
            pictureView.model = model?.pics
            
            pHeight.constant = (model?.pHeight)!
            
            guard let headPic = model?.user?.head_pic else {
                headIV.image = #imageLiteral(resourceName: "aa")
                return
            }
            
            headIV.kf.setImage(with: URL(string: (headPic)), placeholder: #imageLiteral(resourceName: "aa"))
        }
    }
}
